package org.mspring.mlog.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Gao Youbo
 * @since 2014年10月13日
 */
@Component
public class SettingInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        request.setAttribute("base", request.getContextPath());
        request.setAttribute("theme_url", request.getContextPath() + "/themes/default");
        return super.preHandle(request, response, handler);
    }
}